package com.shundr.auth.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.shundr.auth.channel.R;
import com.shundr.auth.base.BaseActivity;
import com.shundr.auth.frame.util.StringUtil;
import com.shundr.auth.frame.util.ToastHelper;

public class ChannelInfoActivity extends BaseActivity {

	private EditText etChannelName;
	private EditText etChannelContact;
	private EditText etContactPhone;
	private EditText etChannelAddr;
	private EditText etChannelRemark;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_add_new_channel);
	}

	private void initView() {
		etChannelName = (EditText) findViewById(R.id.et_channel_name);
		etChannelContact = (EditText) findViewById(R.id.et_channel_contact);
		etContactPhone = (EditText) findViewById(R.id.et_contact_phone);
		etChannelAddr = (EditText) findViewById(R.id.et_channel_addr);
		etChannelRemark = (EditText) findViewById(R.id.et_channel_remark);

		etChannelName.setEnabled(false);
		etChannelContact.setEnabled(false);
		etContactPhone.setEnabled(false);
		etChannelAddr.setEnabled(false);
		etChannelRemark.setEnabled(false);

		findViewById(R.id.btn_add).setVisibility(View.GONE);
		;

	}

	private boolean check() {

		if (StringUtil.isNull(etChannelName.getText().toString().trim())) {
			ToastHelper.toastShort(mContext, "请输入渠道名称");
			return false;
		}

		if (StringUtil.isNull(etChannelContact.getText().toString().trim())) {
			ToastHelper.toastShort(mContext, "请输入联系人");
			return false;
		}
		if (StringUtil.isNull(etContactPhone.getText().toString().trim())) {
			ToastHelper.toastShort(mContext, "请输入联系电话");
			return false;
		}
		if (StringUtil.isNull(etChannelAddr.getText().toString().trim())) {
			ToastHelper.toastShort(mContext, "请输入渠道地址");
			return false;
		}

		return true;
	}
}
